cmake_minimum_required(VERSION 3.0)  
project(MyCLibrary)  

# 设置 C 标准（可选）  
set(CMAKE_C_STANDARD 11)  
set(CMAKE_C_STANDARD_REQUIRED ON)  

# 自动收集所有 .c 文件（或者手动指定）  
file(GLOB SOURCES "src/*.c")  

# 生成静态库（所有 .c 文件一起编译）  
add_library(lexanalyze STATIC ${SOURCES})  

# 设置头文件搜索路径（如果头文件在 include/ 目录）  
target_include_directories(lexanalyze PUBLIC 
    ${CMAKE_CURRENT_SOURCE_DIR}/include
    ${CMAKE_CURRENT_SOURCE_DIR}/../stl/include)  
# 添加其他库的路径和名称
find_library(OTHER_LIB libstl HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../stl/build)
message(${OTHER_LIB})
target_link_libraries(lexanalyze PUBLIC ${OTHER_LIB})